package com.major.tree.binarytree;

public class BinaryTreeMain {
    public static void main(String[] args) {
        BinaryTree tree = new BinaryTree();
        Node root = new Node(1,"zhangsan");
        Node node2 = new Node(2,"lisi");
        Node node3 = new Node(3,"wanger");
        Node node4 = new Node(4,"mazi");
        Node node5 = new Node(5,"zhaoliu");
        Node node6 = new Node(6,"oujingwei");
        Node node7 = new Node(7,"limingyang");

        tree.setRoot(root);

        root.setLeftNode(node2);
        node2.setLeftNode(node4);
        node2.setRightNode(node5);
        root.setRightNode(node3);
        node3.setLeftNode(node6);
        node3.setRightNode(node7);

        //tree.inoOrder();

        Node node = tree.getNodeByNo(5);
        System.out.println(node.toString());
        System.out.println("====================");
        tree.deleteNode(2);
        //tree.inoOrder();


    }
}
